import { computed } from 'vue'
import { useHead } from '@vueuse/head'
import { storeToRefs } from 'pinia'
import { useSeo } from '/@/stores/seo'

export function useSeoHead() {
    const seo = useSeo()
    const { title, keywords, description } = storeToRefs(seo)

    useHead({
        title: computed(() => title.value || ''),
        meta: [
            { name: 'description', content: computed(() => description.value || '') },
            { name: 'keywords', content: computed(() => keywords.value || '') },
        ],
    })
}